package com.yc.entities.custom;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @author kukaha
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "CustomPatientSaveRequestBean对象", description = "患者基本信息保存请求bean")
public class CustomPatientSaveRequestBean implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "患者信息表id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "院长id")
    @NotBlank(message = "院长id不能为空")
    private String deanId;

    @ApiModelProperty(value = "用户姓名")
    @NotBlank(message = "患者姓名不能为空")
    private String username;

//    @ApiModelProperty(value = "患者头像")
//    @NotBlank(message = "患者头像不能为空")
//    private String patientIcon;

    @ApiModelProperty(value = "用户性别")
    @NotBlank(message = "用户性别不能为空")
    private String sex;

    @ApiModelProperty(value = "用户身份证号")
    private String idCard;


    @JsonFormat(pattern = "yyyy-MM-dd")
//    @NotBlank(message = "患者生日不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME)
    @ApiModelProperty(value = "用户生日")
    private Date brithday;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty(value = "住院号")
    @NotBlank(message = "住院号不能为空")
    private String hospitalNum;

    @ApiModelProperty(value = "对应科室表唯一id")
    @NotNull(message = "科室id不能为空")
    private Integer departmentId;

    @ApiModelProperty(value = "对应医生表唯一id")
    @NotNull(message = "医生id不能为空")
    private Integer doctorId;

    @ApiModelProperty(value = "对应床位表唯一id")
    @NotNull(message = "床位id不能为空")
    private Integer bedId;

    @ApiModelProperty(value = "糖尿病类型 0：无 1：一型 2：二型 3：妊娠 4： 其他")
    @NotBlank(message = "糖尿病类型不能为空")
    private String sugarType;

    @ApiModelProperty(value = "身高")
    private Double height;

    @ApiModelProperty(value = "体重")
    private Double weight;

    @ApiModelProperty(value = "糖化值")
    private Double sugarNum;

    @JsonFormat(pattern = "yyyy-MM-dd")
//    @NotBlank(message = "患者住院时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss", iso = DateTimeFormat.ISO.DATE_TIME)
    @TableField(value = "tohospital_time",fill = FieldFill.INSERT)
    @ApiModelProperty(value = "住院时间")
    private Date toHospitalTime;


}
